<template>
	<view class="containner">
		<view class="content">
			<view class="item" v-for="(item,index) in list">
				<view class="itemImg">
					<image :src="item.goods_details.pg_image[0]" mode=""></image>
				</view>
				<view class="itemInfo">
					<view>{{item.goods_details.pg_name}}</view>
					<view class="fc999">价格：{{item.pg_allpoint}}</view>
					<view class="fc999">时间：{{item.pg_addtime}}</view>
				</view>
			</view>
			<u-loadmore :status="status" />
		</view>
	</view>
</template>

<script>
	import {
		exchangelist
	} from '@/api/user.js'
	export default {
		data() {
			return {
				list: [],
				status: 'loadmore',
				page: 1
			};
		},
		mounted() {
			this.getlist()
		},
		onReachBottom() {
			this.status = 'loading';
			this.page = ++this.page;
			setTimeout(() => {
				this.getlist()
			}, 2000)
		},
		methods: {
			getlist() {
				let that = this
				exchangelist({
					page: this.page
				}).then(res => {
					// console.log(8989,res);
					let arr = res.list;
					arr.map(item=>{
						that.list.push(item)
					})
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.containner {
		min-height: 100vh;
		background-color: #f5f5f5;
		padding: 20upx;

		.content {
			border-radius: 20upx;
			padding: 30upx;
			background-color: #fff;
		}
	}

	.content {
		.item {
			display: flex;
			background: #F0F0F0;
			border-radius: 20upx;
			padding: 20upx;
			margin-top: 30upx;
		}

		.itemImg {
			border-radius: 20upx;
			width: 180upx;
			height: 180upx;

			>image {
				width: 100%;
				height: 100%;
			}
		}

		.itemInfo {
			flex: 1;
			margin-left: 20upx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
		}

		.fc999 {
			font-size: 26upx;
			color: #999;
		}
	}
</style>